package com.ruoyi.wetest.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.wetest.domain.WetestStressTransMetric;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * @author Allen
 * @description 压测报告概述
 * @Date 2024/5/10 17:23
 */
public class WeTestReportSummarizationVo {


    public static class StatsVo {
        private String time;
        private int value;

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public StatsVo(String time, int value) {
            this.time = time;
            this.value = value;
        }
    }

    /**
     * 项目名称
     */
    private String projectId;
    private String projectName;

    /**
     * 压测id
     */
    private String testId;

    /**
     * 状态
     */
    private Integer status;
    /**
     * 目标机器人数
     */
    private Integer tpcu;
    /**
     * 实际机器人数
     */
    private Integer opcu;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 总事务
     */
    private Integer totalTrans;
    /**
     * 事务成功率
     */
    private double transSucRate;

    /**
     * 响应时间 平均耗时 （毫秒）
     */
    private double rtAvgTime;


    /**
     * TPS 每秒平均数
     */
    private double tpsAvgTimes;


    /**
     * 网络流量 发送流量
     */
    private double txMb;

    /**
     * 网络流量 接收流量
     */
    private double rtMb;

    /**
     * 错误统计 事务错误数
     */
    private long transErrorNum;

    //============================================
    /**
     * 在线人数
     */
    private List<Object[]> onlineData;

    /**
     * tps
     */
    private List<Object[]> tpsData;

    /**
     * 发包率
     */
    private List<Object[]> txRateData;
    /**
     * 收包率
     */
    private List<Object[]> rtRateData;

    /**
     * 事务统计数据
     */
    private Collection<WetestStressTransMetric> transMetricList;


    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getTestId() {
        return testId;
    }

    public void setTestId(String testId) {
        this.testId = testId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getTotalTrans() {
        return totalTrans;
    }

    public void setTotalTrans(Integer totalTrans) {
        this.totalTrans = totalTrans;
    }

    public double getTransSucRate() {
        return transSucRate;
    }

    public void setTransSucRate(double transSucRate) {
        this.transSucRate = transSucRate;
    }

    public double getRtAvgTime() {
        return rtAvgTime;
    }

    public void setRtAvgTime(double rtAvgTime) {
        this.rtAvgTime = rtAvgTime;
    }

    public double getTpsAvgTimes() {
        return tpsAvgTimes;
    }

    public void setTpsAvgTimes(double tpsAvgTimes) {
        this.tpsAvgTimes = tpsAvgTimes;
    }

    public double getTxMb() {
        return txMb;
    }

    public void setTxMb(double txMb) {
        this.txMb = txMb;
    }

    public double getRtMb() {
        return rtMb;
    }

    public void setRtMb(double rtMb) {
        this.rtMb = rtMb;
    }

    public long getTransErrorNum() {
        return transErrorNum;
    }

    public void setTransErrorNum(long transErrorNum) {
        this.transErrorNum = transErrorNum;
    }

    public List<Object[]> getOnlineData() {
        return onlineData;
    }

    public void setOnlineData(List<Object[]> onlineData) {
        this.onlineData = onlineData;
    }

    public List<Object[]> getTpsData() {
        return tpsData;
    }

    public void setTpsData(List<Object[]> tpsData) {
        this.tpsData = tpsData;
    }

    public List<Object[]> getTxRateData() {
        return txRateData;
    }

    public void setTxRateData(List<Object[]> txRateData) {
        this.txRateData = txRateData;
    }

    public List<Object[]> getRtRateData() {
        return rtRateData;
    }

    public void setRtRateData(List<Object[]> rtRateData) {
        this.rtRateData = rtRateData;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public void setTransMetricList(Collection<WetestStressTransMetric> transMetricList) {
        this.transMetricList = transMetricList;
    }

    public Collection<WetestStressTransMetric> getTransMetricList() {
        return transMetricList;
    }

    public Integer getTpcu() {
        return tpcu;
    }

    public void setTpcu(Integer tpcu) {
        this.tpcu = tpcu;
    }

    public Integer getOpcu() {
        return opcu;
    }

    public void setOpcu(Integer opcu) {
        this.opcu = opcu;
    }
}
